<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>产品管理</title>
		<meta name="keywords" content="">
		<meta name="description" content="">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<link href="css/css1" rel="stylesheet" type="text/css">
		<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
		<link href="css/bootstrap-theme.min.css" rel="stylesheet" type="text/css">
		<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
		<link href="css/templatemo_style.css" rel="stylesheet" type="text/css">

	</head>

	<body class="templatemo-bdg-gray" bgcolor="D9DFAA">
		<div class="adcenter">
			<script src="js/ggad2_728x90.js"></script>
		</div>

		<h2></h2>
		<h2><span class="gray"></span> 产品管理 <span class="green"></span></h2>
		<div class="container center-block templatemo-form-list-container templatemo-container">
			<div class="col-md-12">
				<s:set name="Product" value="#request.Product" />
				<s:form name="frm" method="post" enctype="multipart/form-data">
					<table>

						<tr>
							<td>
								<table class="table table-striped table-hover">
									<thead>
									<tbody>
										<tr>
											<td>产品名:</td>
											<td><input type="text" name="name" value="<s:property value="
													#Product.name" />"/></td>
										</tr>

										<tr>
											<td>产品号:</td>
											<td><input type="text" name="product_id" value="<s:property value="
													#Product.product_id" />"/></td>
										</tr>
										<tr>
											<td>价格:</td>
											<td><input type="text" name="price" value="<s:property value="
													#Product.price" />"/></td>
										</tr>
										<tr>
											<td>库存:</td>
											<td><input type="text" name="num" value="<s:property value="
													#Product.num" />"/>
											</td>
										</tr>
										<tr>
											<td></td>
											<td>
												<s:radio list="{'海水','淡水'}" label="类型" name="type"
													value="#Product.type" />
											</td>
										</tr>
										<tr>
											<td>上架日期:</td>
											<td><input type="text" name="time" value="<s:date name=" #Product.time"
													format="yyyy-MM-dd" />"/></td>
										</tr>
										<tr>
											<td></td>
											<td>
												<input name="btn1" type="button" value="录入" onclick="add()">
												<input name="btn2" type="button" value="删除" onclick="del()">
												<input name="btn3" type="button" value="更新" onclick="upd()">
												<input name="btn4" type="button" value="查询" onclick="que()">
											</td>
										</tr>
									</tbody>
									</thead>
								</table>
							</td>
							<td>

								<tbody>
									<tr>
										<td align="left">

											<table border=1>
												<tr bgcolor=#f9f9f9>
													<td>供应商</td>
													<td align=center>获得的供应数量</td>
												</tr>
												<s:iterator value="#request.supplyList" id="asupply">
													<tr>
														<td>
															<s:property value="#asupply.supplier_name" />&nbsp;
														</td>
														<td align="center">
															<s:property value="#asupply.sum" />
														</td>
													</tr>
								
								</s:iterator>
								</tbody>	
					</table>
					</td>
					</tr>

					</td>
					</tr>
					</table>
					<s:property value="msg" />
				</s:form>
	</body>
</html>
<script type="text/javascript">
	function add() {
		document.frm.action = "addPro.action";
		document.frm.submit();
	}

	function del() {
		document.frm.action = "delPro.action";
		document.frm.submit();
	}

	function upd() {
		document.frm.action = "updPro.action";
		document.frm.submit();
	}

	function que() {
		document.frm.action = "selPro.action";
		document.frm.submit();
	}
</script>
